{% extends "crm/base.html" %}

{% load tagging_tags %}
{% load i18n %}

{% block body %}
<h1>{{ object.user.first_name }} {{ object.user.last_name }}</h1>

<p><a href="{% url crm_client_edit client_id=object.id%}"><img src="{{ MEDIA_URL }}icons/edit.png" alt="Edit" title="Edit this client record"/></a></p>

<table width="100%">
  <tr>
    <th>Name</th>
    <td>
     {{ object.user.first_name }} {{ object.user.last_name }}
    </td>
  </tr>
  <tr>
    <th>Roles</th>
    <td>
      <table>
	{% for role in object.role_set.all %}
          <tr><td>
	      {{ role.title }}, {{ role.organisation }}
	  </td></tr>
	{% endfor %}
      </table>
    </td>
  </tr>
  <tr>
    <th>EMail</th>
    <td><a href="mailto:{{ object.user.email }}">{{ object.user.email }}</a></td>
  </tr>
  <tr>
    <th>Office Phone</th>
    <td>{{ object.office_phone }}</td>
  </tr>
  <tr>
    <th>Mobile Phone</th>
    <td>{{ object.mobile_phone }}</td>
  </tr>
  <tr>
    <th>Home Phone</th>
    <td>{{ object.home_phone }}</td>
  </tr>
  <tr>
    <th>URL</th>
    <td><a href="{{object.ur}}">{{ object.url }}</a></td>
  </tr>
  <tr>
    <th>Tags</th>
    <td>
      {% tags_for_object object as tags %} 
      {% for tag in tags %}
        <a href="{% url crm_tagged_client tag_name=tag.name %}">{{ tag.name }}</a>
      {% endfor %}
    </td>
  </tr>

</table>

  <h3>Simal data</h3>

  <iframe src="http://simal.16degrees.com.au/person/detail?email={{ object.user.email }}" width="800" height="400"/>


{% endblock %}
